package com.shuma.shopmanage.shopmodule.service.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shuma.shopmanage.model.shop.model.Goods;
import com.shuma.shopmanage.model.shop.model.Operation;
import com.shuma.shopmanage.shopmodule.mapper.OperationMapper;
import com.shuma.shopmanage.shopmodule.service.OperationService;
import org.springframework.stereotype.Service;

@Service
public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation> implements OperationService {
    public void createOperation(Goods goods,String message) {
        Operation operation = new Operation();
        operation.setOperatorId(goods.getManageUserId());
        operation.setGoodsId(goods.getId());
        //根据是否生成id判断
        operation.setMessage(message);
        operation.setType(0);
        save(operation);
    }
    public void createOperation(Goods goods,String message,int type) {
        Operation operation = new Operation();
        operation.setOperatorId(goods.getManageUserId());
        operation.setGoodsId(goods.getId());
        //根据是否生成id判断
        operation.setMessage(message);
        operation.setType(type);
        save(operation);
    }


}
